<template lang="pug">
  div.pointer(@click="screenfull")
    i.iconfont.icon-ffullScreen(:style="{fontSize: size + 'px'}")
</template>

<script>
import screenfull from 'screenfull'

export default{
  props: {
    size: {
      type: Number,
      default: 20
    }
  },
  methods: {
    screenfull () {
      if (!screenfull.enabled) {
        this.$message({
          message: '你的浏览器不支持改功能，请升级或更换浏览器！',
          type: 'warning'
        })
        return false
      }
      screenfull.toggle()
    }
  }
}
</script>

<style lang="sass" scoped>
.pointer
  cursor: pointer
</style>
